/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Ap0stoL2
 * Date: 2023-07-22
 * Time: 17:16
 */

import java.util.*;

class less implements Comparator<Integer>{

    @Override
    public int compare(Integer o1, Integer o2) {
        return o2-o1;
    }
}
public class test1 {


    public static void func(int[] arr){
        arr[1]=23;
        System.out.println(arr[1]);
    }

    public static void main(String[] args) {
        Integer []a={1,2,3,4,5};
//        Arrays.sort(a,(x1,x2)->{
//            return x2-x1;
//        });
        Arrays.sort(a,new Comparator<Integer>(){
            public int compare(Integer o1, Integer o2) {
                return o2-o1;
            }
        });

        for(Integer x:a){
            System.out.print(x+" ");
        }
        System.out.println();
    }



    public static void main2(String[] args) {

        String [] a=new String[10];
        for(int i=0;i<a.length;i++){
            a[i]=new String("a");
        }
        String [] b=a.clone();

        b[1]=new String("b");

        System.out.println(a[1]);
        System.out.println(b[1]);

    }
    public static void main1(String[] args) {
        int[] a = new int[20];
        for(int i=0;i<a.length;i++){
            a[i]=i+1;
        }

//        int[] b;
//        b=a;
//
//        a[1]=233;
//
//        System.out.println(b[1]);

        func(a);
        System.out.println(a[1]);
    }
}
